package com.wyl.login.activity

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.wyl.libbase.extend.setFullScreen
import com.wyl.base.ACacheHelper
import com.wyl.base.LoginPage
import com.wyl.base.TimetablePage
import com.wyl.libbase.extend.openActivity
import com.wyl.libbase.utils.CountDownUtils
import com.wyl.login.R

class SplashActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setFullScreen()
        setContentView(R.layout.splash_activity)

        CountDownUtils.delay(2) {
            if (ACacheHelper.hasLogin()) {
                openActivity(TimetablePage)
                finish()
            } else {
                openActivity(LoginPage)
                finish()
            }
        }
    }
}
